package com.pay.domain.order.adapter.repository;

import com.pay.domain.order.model.aggregate.CreateOrderAggregate;
import com.pay.domain.order.model.entity.OrderEntity;
import com.pay.domain.order.model.entity.PayOrderEntity;
import com.pay.domain.order.model.entity.ShopCartEntity;

import java.util.List;

public interface IOrderRepository {
    void doSaveOrder(CreateOrderAggregate orderAggregate);

    OrderEntity queryUnPayOrder(ShopCartEntity shopCartEntity);
    
    /**
     * 更新订单支付的信息
     * @param payOrderEntity
     */
    void updateOrderPayInfo(PayOrderEntity payOrderEntity);
    
    /**
     * 修改订单状态为支付成功
     * @param orderId
     */
    void changeOrderPaySuccess(String orderId);
    
    /**
     * 获取没有支付的订单
     * @return
     */
    List<String> queryNoPayNotifyOrder();
    
    /**
     * 获取超时的订单
     * @return
     */
    List<String> queryTimeoutCloseOrderList();
    
    /**
     * 关单的处理
     * @return
     */
    boolean changeOrderClose(String orderId);
}
